﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Resources;
using System.Reflection;
using System.Globalization;
namespace PFAddin1
{
    public partial class Form1 : Form
    {
        public Form1()
        {


           

            InitializeComponent();
            CultureInfo ci = new CultureInfo("en");

             ResourceManager rm = new ResourceManager("PFAddin1.Background", Assembly.GetExecutingAssembly());

            //TheAresAdoNet   是你程序的命名空间,TheAres是TheAres.resources  
            this.BackgroundImage = (Image)rm.GetObject("MyLogo",ci);
        }

        /// <summary>
        /// 程序入口
        /// </summary>
        [STAThread]
        static void Main()
        {
            ResourceWriter rw = new ResourceWriter("Background.resources");

            try
            {
                Image myImage = Image.FromFile("bg1.JPG");

                rw.AddResource("MyLogo", myImage);

                rw.Close();




                Form1 form = new Form1();
                form.Show();
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
    }
}
